<template>
  <view>
  <button type="default" @click="openDatetimePicker">open picker</button>
    <SimpleDateTimePicker
      ref="myPicker"
      @submit="handleSubmit"
      :start-year="1000"
      :end-year="2030"
    />
    <view>{{birthday}}</view>
  </view>
</template>

<script>
import SimpleDateTimePicker from "../../components/timer/buuug7-simple-datetime-picker.vue";

export default {
   components: {
    SimpleDateTimePicker,
  },
  data() {
    return {
      birthday: "",
    };
  },
 computed:{
     birthday(){
       let  timer= new Date()
         return 
     }
 },
   methods: {
    // 打开picker
    openDatetimePicker() {
      this.$refs.myPicker.show();
    },

    // 关闭picker
    closeDatetimePicker() {
      this.$refs.myPicker.hide();
    },

    handleSubmit(e) {
      // {year: "2019", month: "07", day: "17", hour: "15", minute: "21"}
      console.log(e);
      this.birthday = `${e.year}-${e.month}-${e.day}`;
    },
  },
}
</script>

<style>

</style>